<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>角色管理</title>
	<meta name="decorator" content="nblank"/>
</head>
<body>
<div class="content container">
	<h2 class="page-title">角色管理<small> 角色列表</small></h2>
	<section class="widget widget-tabs widget-table-overflow ">
		<header>
			<ul class="nav nav-tabs">
				<li class="active"><a href="javascript:;">角色列表</a></li>
				<shiro:hasPermission name="sys:role:edit"><li><a href="${ctx}/sys/role/form">角色添加</a></li></shiro:hasPermission>
			</ul>
		</header>
	<%--<sys:message content="${message}"/>--%>
		<div class="body tab-content">
			<table id="contentTable" class="table table-striped table-condensed">
				<tr><th>角色名称</th><th>英文名称</th><th>归属机构</th><th>数据范围</th><shiro:hasPermission name="sys:role:edit"><th>操作</th></shiro:hasPermission></tr>
				<c:forEach items="${list}" var="role">
					<tr>
						<td><a href="form?id=${role.id}">${role.name}</a></td>
						<td><a href="form?id=${role.id}">${role.enname}</a></td>
						<td>${role.office.name}</td>
						<td>${fns:getDictLabel(role.dataScope, 'sys_data_scope', '无')}</td>
						<shiro:hasPermission name="sys:role:edit"><td>
							<a href="${ctx}/sys/role/assign?id=${role.id}">分配</a>
							<c:if test="${(role.sysData eq fns:getDictValue('是', 'yes_no', '1') && fns:getUser().admin)||!(role.sysData eq fns:getDictValue('是', 'yes_no', '1'))}">
								<a href="${ctx}/sys/role/form?id=${role.id}">修改</a>
							</c:if>
							<a href="${ctx}/sys/role/delete?id=${role.id}" class="no-pjax" onclick="confirmx('确认要删除该角色吗？', this.href);return false;">删除</a>
						</td></shiro:hasPermission>
					</tr>
				</c:forEach>
			</table>
		</div>
	</section>
</div>
</body>
</html>